package masterjava.common.configuration.store;

import masterjava.common.logging.MasterLogger;
import masterjava.common.property.Property;

/**
 * User: GKislin
 * Date: 19.02.11
 *
 * Properties store
 * Implementations must have constructor with storeName String argument
 */
public abstract class AbstractPropertiesStore implements IPeopertiesStore {

    protected static final MasterLogger LOGGER = MasterLogger.get(AbstractPropertiesStore.class);

    protected void addConfigurationListener(Property<?> prop) {
        // ignore
    }

    public <T> Property<T> createProp(String key, T defValue, Class<T> clazz) throws IllegalArgumentException {
        Property<T> prop = new Property<T>(key, defValue, clazz, this);
        addConfigurationListener(prop);
        return prop;
    }
}
